package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PhotographerMapper;
import com.ruoyi.system.domain.Photographer;
import com.ruoyi.system.service.IPhotographerService;

/**
 * 摄影师信息Service业务层处理
 * 
 * @author Eugene
 * @date 2023-04-14
 */
@Service
public class PhotographerServiceImpl implements IPhotographerService 
{
    @Autowired
    private PhotographerMapper photographerMapper;

    /**
     * 查询摄影师信息
     * 
     * @param id 摄影师信息主键
     * @return 摄影师信息
     */
    @Override
    public Photographer selectPhotographerById(Long id)
    {
        return photographerMapper.selectPhotographerById(id);
    }

    /**
     * 查询摄影师信息列表
     * 
     * @param photographer 摄影师信息
     * @return 摄影师信息
     */
    @Override
    public List<Photographer> selectPhotographerList(Photographer photographer)
    {
        return photographerMapper.selectPhotographerList(photographer);
    }

    /**
     * 新增摄影师信息
     * 
     * @param photographer 摄影师信息
     * @return 结果
     */
    @Override
    public int insertPhotographer(Photographer photographer)
    {
        photographer.setCreateTime(DateUtils.getNowDate());
        return photographerMapper.insertPhotographer(photographer);
    }

    /**
     * 修改摄影师信息
     * 
     * @param photographer 摄影师信息
     * @return 结果
     */
    @Override
    public int updatePhotographer(Photographer photographer)
    {
        photographer.setUpdateTime(DateUtils.getNowDate());
        return photographerMapper.updatePhotographer(photographer);
    }

    /**
     * 批量删除摄影师信息
     * 
     * @param ids 需要删除的摄影师信息主键
     * @return 结果
     */
    @Override
    public int deletePhotographerByIds(Long[] ids)
    {
        return photographerMapper.deletePhotographerByIds(ids);
    }

    /**
     * 删除摄影师信息信息
     * 
     * @param id 摄影师信息主键
     * @return 结果
     */
    @Override
    public int deletePhotographerById(Long id)
    {
        return photographerMapper.deletePhotographerById(id);
    }
}
